﻿<!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<title><{config_item('manager_title')}></title>
	<link href="/public/H-ui/css/H-ui.min.css" rel="stylesheet" type="text/css" />
	<link href="/public/H-ui/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
	<link href="/public/H-ui/hui-iconfont/iconfont.css" rel="stylesheet" type="text/css">
</head>
<body>
<nav class="breadcrumb">
	<i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 会员管理 <span class="c-gray en">&gt;</span> 积分账户 <a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="pd-20" style="padding-top: 0px;">
	<div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l">
		<a href="javascript:;" class="btn btn-primary radius" onclick="online_recharge(<{$m_id}>);"><i class="Hui-iconfont">&#xe600;</i> 增加积分</a>
		<a href="javascript:;" class="btn btn-primary radius" onclick="withdraw(<{$m_id}>);"><i class="Hui-iconfont">&#xe600;</i> 扣除积分</a>
	</span></div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-hover table-sort">
			<thead>
			<tr class="text-c">
				<th width="40"><input name="" type="checkbox" value=""></th>
				<th width="50">ID</th>
				<th width="80">分值</th>
				<th width="80">类型</th>
				<th width="150">时间</th>
				<th>备注</th>
			</tr>
			</thead>
			<tbody>
			<{foreach $list as $key}>
			<tr class="text-c">
				<td><input name="id[]" type="checkbox" value="<{$key.id}>"></td>
				<td><{$key.id}></td>
				<td class="text-l"><{$key.amount}></td>
				<td class="text-l"><{$event_name[$key.event]}></td>
				<td><{date('Y-m-d H:i:s',$key.addtime)}></td>
				<td class="text-l"><{$key.note}></td>
			</tr>
			<{/foreach}>
			</tbody>
		</table>
	</div>
</div>
<!--分页-->
<{page_view('page',$page_count,search_array_to_link($search_where))}>
<script type="text/javascript" src="/public/js/jquery.js"></script>
<script type="text/javascript" src="/public/js/layer/layer.js"></script>
<script type="text/javascript" src="/public/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/public/js/form.js"></script>
<script type="text/javascript" src="/public/H-ui/js/H-ui.js"></script>
<script type="text/javascript" src="/public/H-ui/js/H-ui.admin.js"></script>
<script type="text/javascript" src="/public/js/laydate/laydate.js"></script>
<script language="JavaScript">
	//增加用户积分
	function online_recharge(id){
		layer.prompt({
			title: '请输入增加积分',
			formType: 0 //prompt风格，支持0-2
		}, function(note){
			//提交请求
			$.ajax({
				type:"POST",
				url: "/manager/member/user/point_online_recharge/"+id,
				data: "amount="+note,
				dataType:"json",
				success: function(data){
					if (data.status=='y') {
						layer.msg('增加完成');
						setTimeout(function(){
							window.location.reload();
						},1000)
					} else {
						layer.msg(data.info);
					}
				}
			});
		});
	}

	//扣除用户积分
	function withdraw(id){
		layer.prompt({
			title: '请输入扣除积分',
			formType: 0 //prompt风格，支持0-2
		}, function(note){
			//提交请求
			$.ajax({
				type:"POST",
				url: "/manager/member/user/point_withdraw/"+id,
				data: "amount="+note,
				dataType:"json",
				success: function(data){
					if (data.status=='y') {
						layer.msg('扣除完成');
						setTimeout(function(){
							window.location.reload();
						},1000)
					} else {
						layer.msg(data.info);
					}
				}
			});
		});
	}

	$(function(){
		//表单回填
		var formObj = new Form();
		formObj.init(<{ch_json_encode($search_where)}>);
	})
</script>
</body>
</html>